#include <stm32l1xx.h>
#include <irc.h>

void irc_init(void) {

	//zapnut hodiny
//	TIM4 -> CCMR1 |= TIM_CCMR1_OC1FE | TIM_CCMR1_OC1PE | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2;
//	TIM4 -> CCER |= TIM_CCER_CC1E;
//	TIM4 -> CR1 |= TIM_CR1_CEN; // enable TIMER 4

//	SET_BIT(TIM3 -> CCMR1,TIM_CCMR1_CC2S_0 | TIM_CCMR1_CC1S_0); // IC2=>TI2, IC1=>TI1
//	SET_BIT(TIM3 -> CCER,TIM_CCER_CC2E | TIM_CCER_CC1E);
	SET_BIT(TIM3 -> SMCR,TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0);
//	SET_BIT(TIM3 -> CR2);
	
	TIM3 -> ARR = 65535;
	SET_BIT(TIM3 -> CR1,TIM_CR1_CEN); //zapnutie pocitadla IRCcka
}

